<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" media="screen" href="/css/bootstrap.min.css">
</head>
<body>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
	<form class="form-horizontal" onsubmit="return false" id="form">
		<fieldset>
			<div class='form-group'>
				<label class='col-md-2 control-label'>clientId</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='clientId' type='text' name='clientId' id='clientId' data-bv-notempty='true' data-bv-notempty-message='clientId 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>resourceIds</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='resourceIds' type='text' name='resourceIds' id='resourceIds' data-bv-notempty='true' data-bv-notempty-message='resourceIds 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>clientSecret</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='clientSecret' type='text' name='clientSecret' id='clientSecret' data-bv-notempty='true' data-bv-notempty-message='clientSecret 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>scope</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='scope' type='text' name='scope' id='scope' data-bv-notempty='true' data-bv-notempty-message='scope 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>authorizedGrantTypes</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='authorizedGrantTypes' type='text' name='authorizedGrantTypes' id='authorizedGrantTypes' data-bv-notempty='true' data-bv-notempty-message='authorizedGrantTypes 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>webServerRedirectUri</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='webServerRedirectUri' type='text' name='webServerRedirectUri' id='webServerRedirectUri' data-bv-notempty='true' data-bv-notempty-message='webServerRedirectUri 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>authorities</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='authorities' type='text' name='authorities' id='authorities' data-bv-notempty='true' data-bv-notempty-message='authorities 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>accessTokenValidity</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='accessTokenValidity' type='text' name='accessTokenValidity' id='accessTokenValidity' data-bv-notempty='true' data-bv-notempty-message='accessTokenValidity 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>refreshTokenValidity</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='refreshTokenValidity' type='text' name='refreshTokenValidity' id='refreshTokenValidity' data-bv-notempty='true' data-bv-notempty-message='refreshTokenValidity 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>additionalInformation</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='additionalInformation' type='text' name='additionalInformation' id='additionalInformation' data-bv-notempty='true' data-bv-notempty-message='additionalInformation 不能为空'>
				</div>
			</div>
			<div class='form-group'>
				<label class='col-md-2 control-label'>autoapprove</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='autoapprove' type='text' name='autoapprove' id='autoapprove' data-bv-notempty='true' data-bv-notempty-message='autoapprove 不能为空'>
				</div>
			</div>


			<div class="form-actions">
				<div class="row" align="center">
					<div class="col-md-12">
					    <button class="btn btn-primary" onclick="location.href='oauthClientDetailsList.html'">返回</button>
						<button class="btn btn-primary" type="submit" onclick="add()">
							<i class="fa fa-save"></i> 保存
						</button>
					</div>
				</div>
			</div>

		</fieldset>
	</form>
</div>
	<script type="text/javascript" src="/js/libs/jquery-2.1.1.min.js"></script>
	<script type="text/javascript" src="/js/jq.js"></script>
	<script type="text/javascript" src="/js/plugin/bootstrapvalidator/bootstrapValidator.min.js"></script>
	<script type="text/javascript" src="/js/common.js"></script>
	<script type="text/javascript" src="/layui/layui.js"></script>
	<script type="text/javascript">
		layui.use(['layer','laydate'], function(){
		    var layer = layui.layer;
		});
		
		function add() {
			$('#form').bootstrapValidator();
			var bootstrapValidator = $("#form").data('bootstrapValidator');
			bootstrapValidator.validate();
		    if(!bootstrapValidator.isValid()){
			   return;
		    }
		    
		    var formdata = $("#form").serializeObject();

			$.ajax({
				type : 'post',
				url : '/oauthClientDetailss',
				contentType: "application/json; charset=utf-8",  
				data : JSON.stringify(formdata),
				success : function(data) {
					layer.msg("添加成功", {shift: -1, time: 1000}, function(){
                        location.href = "oauthClientDetailsList.html";
                    });
				}
			});
		}
		
	</script>
</body>
</html>
